/*
    Dominate 3D - A cube-based game of life

    Copyright (C) 2007, Craig H. Miller (kidmosey@gmail.com)

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __IMAGE_H__
#define __IMAGE_H__

#include <string.h>

class CImage
{
public:
    CImage(const char *fname): data(0), width(0), height(0), bpp(0)
    {
    }

    virtual ~CImage()
    {
        //delete filename;
        //filename = 0;

        delete data;
        data = 0;
    }

    virtual int Load(const char *) = 0;

    unsigned int GetWidth()  { return width;  }
    unsigned int GetHeight() { return height; }

    unsigned char *GetData() { return data; }
    //char *GetFilename() { return filename; }

protected:
    //char *filename;
    unsigned char *data;
    unsigned int  width, height, bpp;
};

/** Load an image from a file.
**/
CImage *LoadImageFromFile(const char *fname);

#endif // __IMAGE_H__
